﻿<!DOCTYPE html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <link rel="stylesheet"
          href="../../css/table.css" type="text/css" />
    <link rel="stylesheet"
          href="../../css/cwcalendar.css" type="text/css">
    <script type="text/javascript"
            src="../../javascript/comm/comm.js">
    </script>
    <script type="text/javascript"
            src="../../javascript/comm/list.js">
    </script>
    <script type="text/javascript"
            src="../../javascript/calendar-ch.js">
    </script>
    <script type="text/javascript"
            src="../../javascript/jquery-1.7.2.js">
    </script>
    <script type="text/javascript"
            src="../../javascript/locate.js">
    </script>
    <script src="~/js/jquery-1.11.1.js"></script>
    <script src="~/js/vue.js"></script>
</head>

<body>
    <div id="app">
        <form method="post">
            <table width="100%">
                <tr>
                    <td>
                        <font color="black">您正在做的业务是：人力资源--人力资源档案管理--人力资源档案删除 </font>
                    </td>
                </tr>
                <tr>
                    <td align="right">
                        <input type="button" v-on:click="GetHuman_file()" value="查询" class="BUTTON_STYLE1" />
                    </td>
                </tr>
            </table>
            <table width="100%" border="1" cellpadding=0 cellspacing=1
                   bordercolorlight=#848284 bordercolordark=#eeeeee
                   class="TABLE_STYLE1">
                <tr class="TR_STYLE1">
                    <td width="16%" class="TD_STYLE1">
                        请选择员工所在I级机构
                    </td>
                    <td width="84%" class="TD_STYLE2">
                        <select name="firstKind" size="5" id="firstKind"
                                class="SELECT_STYLE2">
                            <option v-on:click="GetSecond(0)" value="0" selected="selected">全部</option>
                            <option v-on:click="GetSecond(item.first_kind_id)" v-for="(item,index) in first" :value="item.first_kind_id">{{item.first_kind_name}}</option>
                        </select>
                    </td>
                </tr>
                <tr>
                    <td class="TD_STYLE1">
                        请选择员工所在II级机构
                    </td>
                    <td width="84%" class="TD_STYLE2">
                        <select name="secondKind" size="5" id="secondKind"
                                class="SELECT_STYLE2">
                            <option v-on:click="GetThird(0)" id="qb2" value="0" selected="selected">全部</option>
                            <option v-for="(item,index) in second" v-on:click="GetThird(item.second_kind_id)" :value="item.second_kind_id">{{item.second_kind_name}}</option>
                        </select>
                    </td>
                </tr>
                <tr class="TR_STYLE1">
                    <td width="16%" class="TD_STYLE1">
                        请选择员工所在III级机构
                    </td>
                    <td width="84%" class="TD_STYLE2">
                        <select name="thirdKind" class="SELECT_STYLE2" size="5" id="thirdKind">
                            <option value="0" id="qb3" selected="selected">全部</option>
                            <option v-for="(item,index) in third" :value="item.third_kind_id">{{item.third_kind_name}}</option>
                        </select>
                    </td>
                </tr>
                <tr>
                    <td class="TD_STYLE1">
                        请选择职位分类
                    </td>
                    <td width="84%" class="TD_STYLE2">
                        <select name="humanFile.humanMajorKindId" size="5" id="majorKind" class="SELECT_STYLE2">
                            <option value="0" v-on:click="GetMajor(0)" selected="selected">全部</option>
                            <option v-for="(item,index) in majorkind" v-on:click="GetMajor([item.major_kind_id])" :value="item.major_kind_id">{{item.major_kind_name}}</option>
                        </select>
                    </td>
                </tr>
                <tr class="TR_STYLE1">
                    <td width="16%" class="TD_STYLE1">
                        请选择职位名称
                    </td>
                    <td width="84%" class="TD_STYLE2">
                        <select name="humanFile.humanMajorId" size="5" class="SELECT_STYLE2" id="majorName">
                            <option value="0" id="qb4" selected="selected">全部</option>
                            <option v-for="(item,index) in major" :value="item.major_id">{{item.major_name}}</option>
                        </select>
                    </td>
                </tr>
                <tr>
                    <td class="TD_STYLE1">
                        请输入建档时间
                    </td>
                    <td width="84%" class="TD_STYLE2">
                        <input type="date" name="startDate" style="width: 14%" class="INPUT_STYLE2" id="startDate">
                        至
                        <input type="date" name="endDate" style="width: 14%" class="INPUT_STYLE2" id="endDate">
                    </td>
                </tr>
            </table>
        </form>
        </div>
</body>
<script type="text/javascript">
    var vm = new Vue({
        el: "#app",
        data: {
            first: [],
            second: [],
            third: [],
            majorkind: [],
            major: [],
        },
        methods: {
            load: function () {
                var t = this;
                $.ajax({
                    url: "/HumanResources/GetXiaLaKuang",
                    type: "Get",
                    success: function (msg) {
                        var dts = eval("(" + msg + ")");
                        t.first = dts["first"];
                        t.majorkind = dts["majorkind"];
                    }
                })
            },
            GetSecond: function (fid) {
                var t = this;
                $.ajax({
                    url: "/HumanResources/GetSecond",
                    type: "Get",
                    data: "ids=" + fid,
                    success: function (msg) {
                        t.second = eval(msg);
                        if (fid != 0) {
                            t.GetThird(t.second[0].second_kind_id);
                            $("#qb2").prop("selected", true);
                        } else {
                            t.GetThird(0);
                            $("#qb2").prop("selected", true);
                        }

                    }
                })
            },
            GetThird: function (sid) {
                var t = this;
                $.ajax({
                    url: "/HumanResources/GetThird",
                    type: "Get",
                    data: "ids=" + sid,
                    success: function (msg) {
                        t.third = eval(msg);
                        $("#qb3").prop("selected", true);
                    }
                })
            },
            GetMajor: function (mid) {
                var t = this;
                $.ajax({
                    url: "/HumanResources/GetMajor",
                    type: "Get",
                    data: "ids=" + mid,
                    success: function (msg) {
                        t.major = eval(msg);
                        $("#qb4").prop("selected", true);
                    }
                })
            },
            GetHuman_file: function () {
                var where = " check_status = '2' ";
                var StartTime = $("#startDate").val();
                var EndTime = $("#endDate").val();
                var thirdKind = $("#thirdKind").val();
                var secondKind = $("#secondKind").val();
                var firstKind = $("#firstKind").val();
                var majorKind = $("#majorKind").val();
                var majorName = $("#majorName").val();
                if (StartTime != "") {
                    if (EndTime != "") {
                        where += " and regist_time between '" + StartTime + "' and '" + EndTime + "'  ";
                    }
                }
                if (thirdKind != 0) {
                    where += " and third_kind_id =  '" + thirdKind + "' ";
                } else if (secondKind != 0) {
                    where += " and secondKind =  '" + secondKind + "' ";
                } else if (firstKind != 0) {
                    where += " and firstKind =  '" + firstKind + "' ";
                }

                if (majorName != 0) {
                    where += " and human_major_kind_id =  '" + majorName + "' ";
                } else if (majorKind != 0) {
                    where += " and human_major_id =  '" + majorKind + "' ";
                }
                window.location.href = '/HumanResources/delete_list?where=' + where;
            }
        },
        mounted: function () {
            this.load();

        }
    })
</script>
